//
//  RZSlideMenuView.h
//  Doumi
//
//  Created by reyzhang on 2021/3/19.
//  侧滑菜单功能封装

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(NSInteger, SlideDirection) {
    DirectionFromLeft,
    DirectionFromRight,
};


//控件配置
@interface RZSlideMenuConfig : NSObject
@property (nonatomic, assign) SlideDirection direction;
@property (nonatomic, assign) CGFloat leftMargin;
@property (nonatomic, assign) CGFloat rightMargin;
@property (nonatomic, assign) CGFloat topMargin;
@property (nonatomic, assign) CGFloat contentWidth;
@property (nonatomic, assign) CGFloat cellHeight;
@end


//控件数据模型
@interface RZSlideMenuModel : NSObject
@property (nonatomic, strong) NSString *icon;
@property (nonatomic, strong) NSString *name;

+ (instancetype)createWithIcon:(NSString *)icon name:(NSString *)name;
@end



//控件
@interface RZSlideMenuView : UIView
@property (nonatomic, strong) NSArray<RZSlideMenuModel *> *menuArray;
@property (nonatomic, assign,readonly) BOOL isShow;
@property (nonatomic, copy) void(^selectMenuAtIndex)(NSInteger index, RZSlideMenuModel *model);

/**
 根据配置初始化
 */
- (instancetype)initWithConfig:(RZSlideMenuConfig *)config;


- (void)showWithAnimation:(BOOL)animation;

- (void)hideWithAnimation:(BOOL)animation;
@end


//tablecell
@interface RZSlideMenuTableCell : UITableViewCell
@property (nonatomic, strong) RZSlideMenuModel *menuModel;
@end

NS_ASSUME_NONNULL_END
